/*---------------------------------------------------------------------------*/
#include <QtGui>
#include "MenuButton.h"
#include <string>
#include <iostream>
#include "Config.h"
#include "Utils.h"
/*---------------------------------------------------------------------------*/
using namespace std;
/*---------------------------------------------------------------------------*/
MenuButton::MenuButton() : QPushButton()
{


	
}
/*---------------------------------------------------------------------------*/
MenuButton::MenuButton(char *label, char *iconstr, int w, int h, char *tooltip)  : QPushButton(label)
{
	if( iconstr )
	{
		QIcon icon;
		
		// get images from /usr/share 
		string path = "/usr/share/gfm/images/";
		path += iconstr;
		icon.addFile(path.c_str());
		// get images from working dir
		path = "./images/";
		path += iconstr;
		icon.addFile(path.c_str());
		
		setIcon( icon );
		
		DEBUGMSG( "MenuButton::MenuButton() : load icon \"" << iconstr << "\"" );
	}
	
	if( w ) setMaximumWidth(w);
	if( h ) setMaximumHeight(h);
	if( tooltip ) setToolTip(tooltip);
	
}
/*---------------------------------------------------------------------------*/
MenuButton::~MenuButton()
{
	
}
/*---------------------------------------------------------------------------*/




